
package com.huatie.springbootrabbitmq.service;

import com.huatie.springbootrabbitmq.model.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Service;

@Service
public class RabbitMQConsumer {

    @RabbitListener(queues = "${spring.rabbitmq.template.default-receive-queue:message_queue}")
    public void receiveMessage(Message message) {
        System.out.println("接收消息: " + message);
        // 这里可以添加业务逻辑处理
    }
}
